# encoding: utf-8

import os

from sqlalchemy import create_engine
from sqlalchemy.orm import  sessionmaker

from app.modules.apps.models import App

PROJECT_ROOT = os.path.basename('/')
print PROJECT_ROOT
SQLALCHEMY_DATABASE_URI = 'sqlite:///%s' % (os.path.join(PROJECT_ROOT, "example.db"))

engine = create_engine(SQLALCHEMY_DATABASE_URI, echo=True)
create_session = sessionmaker(bind=engine)


# class AppManager(object):
#
#     @staticmethod
#     def query_all_apps():
#         session = create_session()
#         query = session.query(App)
#         apps = query.all()
#         session.close()
#
#         return apps
